"use strict";


function checkPage(id,entId,flag,auditStatus,auditOpinion,checkFlag){
    var url = ctx + "/bus/entAudit/check?auditId="+id+"&entId="+entId+"&auditStatus="+auditStatus+"&auditOpinion="+auditOpinion+"&checkFlag="+checkFlag;
    var url1=ctx+"/bus/entAudit/changeAuditStatus";
    var url2=ctx+"/bus/entAudit/changeAuditStatus?entId="+entId+"&updateFlag=2&id="+id+"&auditOpinion=";

    if(flag=='0'){
        layer.open({
            type :2,
            fix : true,
            title : ['养殖场详细信息',
                'font-family: Arial Negreta; font-size:20px; font-weight: 700; color:#33A5E7;'],
            skin : "self-def", /* 自定义按钮样式 */
            anim : "5", /* 动画效果 */
            scrollbar:false,
            move : [ '.layui-layer-title', true ],
            area : [ "85%", "80%" ],
            content : url,
            btn : [ "通过", "驳回" ],
            yes : function(index, layero) {
                layer.confirm  ('确定要批准该条备案申请吗？',{icon: 3,title:'系统提示',
                        btn:'确定',},function(){
                    $.ajax({
                        type: "post",
                        url: url1,
                        data: {entId:entId,updateFlag:'1',id:id},
                        success:function(data) {
                                layer.msg("审核成功！", {icon: 1, time: 1000}, function (){
                                    window.location.reload();
                                })
                        }
                    });
                });
            },
            btn2 : function(index, layero) {
              promptx("系统提示","驳回原因",url2,'function');
                return false;
            }
        });
    }
    if(flag=='1'){
        layer.open({
            type :2,
            fix : true,
            title : ['养殖场详细信息',
                'font-family: Arial Negreta; font-size:20px; font-weight: 700; color:#33A5E7;'],
            skin : "self-def", /* 自定义按钮样式 */
            anim : "5", /* 动画效果 */
            scrollbar:false,
            move : [ '.layui-layer-title', true ],
            area : [ "85%", "80%" ],
            content : url,
            btn : ['关闭']
        });
    }
}

function promptx(title, lable, href, closed){
    top.$.jBox("<div class='form-search' style='padding:20px;text-align:center;width:=800px;height:118px;'>" + lable + "：<textarea id='txt' name='txt' maxlength='90' style='height:118px;width: 200px'></textarea></div>", {
        title: title, submit: function (v, h, f){
            if (f.txt == '') {
                top.$.jBox.tip("请输入" + lable + "。", 'error');
                return false;
            }
            if (typeof href == 'function') {
                href();
            }else{
                resetTip(); //loading();
                location = href + encodeURIComponent(f.txt);
            }
        },closed:function(){
            if (typeof closed == 'function') {
                closed();
            }
        }});
    return false;
}